// this module generates branch address for bne and beq
// and back up pc+8 for jal
module AddrGenerate(
    input [31:0] pc4_from_ID_EX,
    input [31:0] Ext_imm_from_ID_EX,
    output [31:0] pc8_EX,
    output [31:0] AddrBranch            //Address of bne,beq
);
wire [31:0] shift;
assign shift = {Ext_imm_from_ID_EX[29:0],2'b0};    // left shift 2bit
assign AddrBranch = shift + pc4_from_ID_EX;
assign pc8_EX = pc4_from_ID_EX + 32'd4;
endmodule